package com.example.librarymanagementsystembackend.utils;

import lombok.Data;

@Data
public class InvalidRequestException extends RuntimeException {

    private int errorCode;

    public InvalidRequestException(String message) {
        super(message);
        // 默认是数据验证失败，可以是客户请求发送的数据不符合业务规定，如图书ISBN冲突、id不存在……
        this.errorCode = 422;
    }
    public InvalidRequestException(int errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }
}
